pp108 : Creating a Composite Control using a REST URL

Creating a Composite Control using a REST URL

This topic describes the procedure to create a composite control using a REST URL.

In addition to manually creating a composite control using design-time and run-time type libraries, you can also create a composite control from a REST URL. Representational State Transfer or REST refers to an architecture in which possible interactions are represented by URLs, the use of which renders resulting information as Web pages on the client computer. An information set rendered as a Web page on the client computer is referred to as a state, while the URL is a representation of the state. Changes in state brought about by changes in representation is called Representational State Transfer.

REST URLs comprise parameters based on which information is rendered. Changing the parameter values leads to changes in the rendered information. In other words, you can retrieve and view information by providing appropriate parameter values in the REST URL itself.

Process Platform XForms provides the functionality to create a user interface for a REST URL. The interface is saved as a composite control and can be reused in XForms as required. In addition, you can use a message map to set or manipulate the REST URL parameters that you specify while creating the control.

  1. Access the Composite Control Modeler () to create a composite control using a REST URL. The Untitled Composite Control - Composite Control wizard appears.
  2. Make appropriate modifications in the Untitled Composite Control - Composite Control wizard.
    • Type the name of the composite control in the Name field.
    • Type a description of the composite control in the Description field.
    • Select the REST URL Control Type option is to create URL-based composite control.


      Note: The Control Control Type option is used to create composite controls based on design-time and run-time libraries.


      The title of the wizard changes to <composite control> - Composite Control. The REST URL tab appears where you can specify details regarding the URL to be used to create the composite control.
  3. Enter the URL to be used to create the composite control in the URL field and tab out or click outside the field. The parameters available in the URL for creating a composite control are displayed in the Configure URL Parameters table. The parameter details are displayed in the Name and Default Value columns.
  4. To use a parameter in the composite control, select its corresponding check box in the Use in Map column. The selected parameter is available for use at runtime, that is it is possible to set its value at runtime.
  5. Provide a description for the parameter in the Description column. When you later use the message map, this description is used to represent the selected parameter. To make it easier to identify the parameter, ensure that you provide a meaningful description.
  6. To customise the run-time behavior of the composite control, select the Behavior tab, and specify the run-time library in the Runtime Library field. To do so,
    1. Click to create a run-time library and click Yes in the Confirm dialog box that displays. The <library>.htm - Htm dialog box displays


      Note: Alternately, click to specify an existing run-time library from the Select Design Time Library dialog box that displays.


    2. Make appropriate modifications in the <library>.htm - Htm dialog box.
    3. Type the name of the library in the Name field.
    4. Type a description for the design-time library in the Description field.
    5. In the Location field, select and specify the location at which the library must be saved in the Select Folder dialog box that displays. The <library>.htm - Htm dialog box displays the standard code structure using which you can build your library.
    6. Add the code to create the run-time control.


      Note: It is also possible to specify a design-time library for a REST-URL based composite control. In such cases, the design-time library will be used to define the design-time behavior of the composite control, overriding the REST-URL associated with the control.


  7. Click . This creates a composite control that has the default representation based on the parameter you selected.

    You can now drag the composite control from the Workspace Documents window to an XForm. Alternately, you can right-click the XForm, select Insert Composite Control, and drag the composite control from the Composite Controls dialog box that displays. This right-click menu option is available for a split area, an XForm, and for the Group, Groupbox, and Tab Page grouping controls. Once added to an XForm, you can use a message map to map data.

    When the composite control is used in an XForm, an interface based on the base URL and the specified default parameters is rendered. You can use the message map to pass parameters, based on which the rendered Web page gets updated.